package sugarbind_input

class Structure {

    String iupac
	String glycoct
	Integer glycosuite_Id
	byte[] cfg
	byte[] uoxfcol
	byte[] text
	
    static constraints = {
		iupac(blank:false)
		glycoct(nullable:true)
		glycosuite_Id(nullable:true)
		cfg(nullable:true)
		uoxfcol(nullable:true)
		text(nullable:true)
		
		iupac(unique:true)
	}
	
	static hasMany = [ligands: Ligand]
	
	static mapping = {
//		id column: 'structure_id'
		id generator: 'sequence', params: [sequence: 'structure_id_seq']
	}
	
	public String toString(){
		iupac// + " " + id 
	}
	
	public static listStructures()
	{
		Structure.list().sort{ it.toString(); }
	}
}
